<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns:html="http://www.w3.org/1999/xhtml">

    <xsl:template match="/page">
    	<div class="main">
            <div class="header">
                <img src="images/easyCMXlogo1.jpg" alt="EasyCMX Logo" />
                <img src="images/easyCMXlogoletters.jpg" />
            </div>                
            
            <div class="menu">
            	<span>
                	<span id="menu">
            			<script>buildMenu()</script>
                    </span>
                </span>
            </div>
         
            <div class="c1">
                
                <div class="c1top">
                    <span>
                        <span>
                            <div class="inner"><h1><span>+</span><xsl:value-of select="//heading"/></h1></div>
                        </span>
                    </span>
                </div>
                
                <div class="c1bot">
    
                    <h3><xsl:value-of select="//subhead"/></h3>
                    
                    <div class="content">
                        <xsl:copy-of select="//content/*"/>
                    </div>
                </div>
            </div>
            
            <div class="footer">
                Copyright 2008. All rights reserved.
            </div>
		</div>
    </xsl:template>
    
    <xsl:template match="/newsfeed">
        <div class="main">
            <div class="header">
                <img src="images/easyCMXlogo1.jpg" alt="EasyCMX Logo" />
                <img src="images/easyCMXlogoletters.jpg" />
            </div>                
            
            <div class="menu">
            	<span>
                	<span id="menu">
            			<script>buildMenu()</script>
                    </span>
                </span>
            </div>
            
            <div class="c1">
                
                <div class="c1top">
                    <span>
                        <span>
                            <div class="inner"><h1><span>+</span><xsl:value-of select="//heading"/></h1></div>
                        </span>
                    </span>
                </div>
                
                <div class="c1bot">
            
                    <div class="content">
                    
                        <div class="newsfeed">
                        
                        <xsl:for-each select="story">
                            <xsl:sort select="date/@y" data-type="number" order="descending" />
                            <xsl:sort select="date/@m" data-type="number" order="descending" />
                            <xsl:sort select="date/@d" data-type="number" order="descending" />
                            <xsl:sort select="date/@h" data-type="number" order="descending" />
                            <xsl:sort select="date/@m" data-type="number" order="descending" />
                            <xsl:sort select="author/last" />
                            <xsl:sort select="author/first" />
                            <div class="story">
                                <div class="title">
                                    <xsl:value-of select="title" />
                                </div>
                                <div class="authdate">
                                    by <xsl:value-of select="author/first"/> <xsl:value-of select="author/last"/><br />
                                    on <xsl:value-of select="date/@m"/>/<xsl:value-of select="date/@d"/>/<xsl:value-of select="date/@y"/>
                                </div>
                                <div class="text">
                                    <xsl:copy-of select="text" />
                                </div>
                            </div>
                        </xsl:for-each>
                        </div>
                    </div>
                </div>
        	</div>
            <div class="footer">
                Copyright 2008. All rights reserved.
            </div>
    	</div>
    </xsl:template>


</xsl:stylesheet>